const db = require('../db/index');
const DataType = require('sequelize');
/**es6继承 */
class Reward extends DataType.Model {}
Reward.init(
    {
        id: {
            type: DataType.INTEGER,
            allowNull: false,
            autoIncrement: true,
            primaryKey: true
        },
        userId: {
            type: DataType.INTEGER,
            comment: '用户id',
            allowNull: false
        },
        givingId: {
            type: DataType.INTEGER,
            comment: '用户id',
            allowNull: false
        },
        day: {
            type: DataType.INTEGER,
            comment: '奖励天数',
            allowNull: false
        },
        limit: {
            type: DataType.INTEGER,
            comment: '奖励次数',
            allowNull: false
        },
        isShop: {
            type: DataType.BOOLEAN,
            comment: '是否购买',
            allowNull: false
        }
    },
    {
        tableName: 'reward',
        modelName: 'reward',
        sequelize: db
    }
);
// Reward.sync({ force: true });
exports['default'] = Reward;
